FLAGS = -I./include -L./lib
LIBS = -lsqlite3 -lsqlite3x -lenet -pthread
BUILD = build


server2: server2.cpp database.o network.o clientmanager.o
	g++ -o $@ server2.cpp $(BUILD)/database.o $(BUILD)/network.o $(BUILD)/clientmanager.o $(FLAGS) $(LIBS)

client2: client2.cpp
	g++ -o $@ $< $(FLAGS) $(LIBS)

# deps 
database.o: database.cpp database.h $(BUILD)
	g++ -o $(BUILD)/$@ -c $< $(FLAGS)

network.o: network.cpp network.h $(BUILD)
	g++ -o $(BUILD)/$@ -c $< $(FLAGS)

clientmanager.o: clientmanager.cpp clientmanager.h
	g++ -o $(BUILD)/$@ -c $< $(FLAGS)


$(BUILD):
	mkdir $(BUILD)
